import type { RouteRecordRaw } from "vue-router";
import UserLoginPage from "@/views/user/UserLoginPage.vue";
import UserRegisterPage from "@/views/user/UserRegisterPage.vue";
import { UserRoleEnum } from "@/enums";
import UserAppPage from "@/views/user/UserAppPage.vue";
import UserAnswerPage from "@/views/user/UserAnswerPage.vue";

export const userRoutes: Array<RouteRecordRaw> = [
  {
    path: "/user",
    name: "用户",
    // component: UserLayout,    // 这里不应该有组件
    children: [
      {
        path: "login",
        name: "用户登录",
        component: UserLoginPage,
      },
      {
        path: "register",
        name: "用户注册",
        component: UserRegisterPage,
      },
    ],
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: "/app/my",
    name: "我的应用",
    component: UserAppPage,
    meta: {
      access: UserRoleEnum.USER,
    },
  },
  {
    path: "/answer/my",
    name: "我的回答",
    component: UserAnswerPage,
    meta: {
      access: UserRoleEnum.USER,
    },
  },
]